/*
 * @Author: boyyang
 * @Date: 2022-01-01 23:23:55
 * @LastEditTime: 2022-03-18 21:34:00
 * @LastEditors: boyyang
 * @Description: 项目入口文件
 * @FilePath: \boyyang\src\main.ts
 */

import App from './App.vue'
import { createApp } from 'vue'
import { setupRouter, router } from './router'
import { setupStore } from '@/store'
import directivePlugin from '@/directive'

// import { boyyangui } from '../plugin/index'
// import '../plugin/dist/style.css'

import { boyyangui } from 'boyyang-ui'
import 'boyyang-ui/dist/style.css'

// md
import VueMarkdownEditor from '@kangc/v-md-editor'
import '@kangc/v-md-editor/lib/style/base-editor.css'

import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'

// 引入所有语言包
import Prism from 'prismjs';

VueMarkdownEditor.use(vuepressTheme, {
    Prism
})

// console.log(boyyangui)


// import '@/utils/TSTEST'

const bootstrap = async () => {
    const app = createApp(App)

    app.use(boyyangui)
    app.use(VueMarkdownEditor)
    app.use(directivePlugin)

    // 挂载store
    setupStore(app)

    // 挂载路由
    setupRouter(app)

    // 路由挂载完毕
    await router.isReady()

    app.mount('#app')
}

void bootstrap()

